﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../css/Jqbox.css" rel="stylesheet" type="text/css" />
    <link href="../css/jquery.loadmask.css" rel="stylesheet" type="text/css" />

    <script src="../js/jquery-1.5.2.min.js" type="text/javascript"></script>
    <script src="../js/ligerui.min.js" type="text/javascript"></script>
    <script src="../Js/jquery.dialog.js" type="text/javascript"></script>
    <script src="../Js/conmon.js" type="text/javascript"></script>
    <script src="../Js/jquery.loadmask.min.js" type="text/javascript"></script>

    <script type="text/javascript" src="../js/Highcharts/highcharts.js"></script>
    <script type="text/javascript" src="../js/Highcharts/exporting.js"></script>
    <title>成绩图表</title>

    <script type="text/javascript">
        var chart, username = null, srouce = null;

        $(document).ready(function () {

            pWind = parent.window.parent.window.getWindow();
            Row = (pWind != null ? pWind.$selectRow : null);

            if (Row == null) {
                showErrorTip("获取参数出错.");
                return;
            }


            $.getJSON('../WebServer/ExamRoom.ashx?Action=chart', { examid: Row.E_ID }, function (data) {
                if (data.IsSuccess == 1) {
                    username = data.Data.Username;
                    srouce = data.Data.Srouce;
                    // begin
                    chart = new Highcharts.Chart({
                        chart: {
                            renderTo: 'container',
                            defaultSeriesType: 'column',
                            margin: [50, 50, 100, 80]
                        },
                        title: {
                            text: Row.E_Name
                        },
                        xAxis: {
                            categories: data.Data.Username,
                            labels: {
                                rotation: -45,
                                align: 'right',
                                style: {
                                    font: 'normal 10px Verdana, sans-serif'
                                }
                            }
                        },
                        yAxis: {
                            min: 0,
                            title: {
                                text: '分数线'
                            }
                        },
                        legend: {
                            enabled: false
                        },
                        tooltip: {
                            formatter: function () {
                                return '<b>' + this.x + '</b><br/>' +
								 '成绩: ' + Highcharts.numberFormat(this.y, 1) +
								 '  (分)';
                            }
                        },
                        series: [{
                            name: 'Population',
                            data: data.Data.Srouce,
                            dataLabels: {
                                enabled: true,
                                rotation: -90,
                                color: '#FFFFFF',
                                align: 'right',
                                x: -3,
                                y: 10,
                                formatter: function () {
                                    return this.y;
                                },
                                style: {
                                    font: 'normal 13px Verdana, sans-serif'
                                }
                            }
                        }]
                    });
                // JSON end
                }
            });


            /* 1.考试名称
            2. 人员名单
            3. 所得分数
            */
        });
    </script>

</head>
<body>
    <div id="container" style="width: 700px; height: 350px; margin: 0 auto"></div>
</body>
</html>
